package pers.mobian.springfirst.firstTest;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test01 {
	public static void main(String[] args) {

		ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-test.xml");
		System.out.println("333");
		System.out.println(context.getEnvironment());
		System.out.println("333 ");


//		UserService userService = (UserService) context.getBean("userService");
//		System.out.println(userService);

		User user = (User) context.getBean("user");

//		User user = userService.getUserById(2);

		System.out.println(user);
		((ClassPathXmlApplicationContext) context).refresh();
		User user2 = (User) context.getBean("user");

		System.out.println(user2);
//		System.out.println(userService1);
	}
}
